
export const openTypeEmits = {
	getphonenumber: (e: any) => true,
	getuserinfo: (e: UniNamespace.GetUserInfoOptions) => true,
	error: (e: any) => true,
	opensetting: (e: any) => true,
	launchapp: (e: any) => true,
	contact: (e: any) => true,
}



export const useOpenType = (emit:any) => {

	// 下面为对接uniapp官方按钮开放能力事件回调的对接
	const getphonenumber = (res: any) => {
		emit("getphonenumber", res);
	}
	const getuserinfo = (res: UniNamespace.GetUserInfoOptions) => {
		emit("getuserinfo", res);
	}
	const error = (res: any) => {
		emit("error", res);
	}
	const opensetting = (res: any) => {
		emit("opensetting", res);
	}
	const launchapp = (res: any) => {
		emit("launchapp", res);
	}
	const contact = (event:any) => {
	    emit('contact', event.detail)
	}
	return {
		getphonenumber,
		getuserinfo,
		error,
		opensetting,
		launchapp,
		contact
	}
}